static void
xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp)
{
+ char *enclosure = "";
+ if (0 == strcmp(fmp->printfc, "\"%s\"")) {
+ enclosure = "\"";
+ }
if (strcmp(fmp->key, "IGNORE") == 0) {
/* IGNORE -- Categorically ignore this... */
} else
/* IGNORE -- Calculated Sequence # For Ouput*/
} else
if (strcmp(fmp->key, "SHORTNAME") == 0) {
- wpt->shortname = csv_stringtrim(s, "", 0);
+ wpt->shortname = csv_stringtrim(s, enclosure, 0);
} else
if (strcmp(fmp->key, "DESCRIPTION") == 0) {
- wpt->description = csv_stringtrim(s, "", 0);
+ wpt->description = csv_stringtrim(s, enclosure, 0);
} else
if (strcmp(fmp->key, "NOTES") == 0) {
wpt->notes = csv_stringtrim(s, "", 0);
"#\n"
"IFIELD LAT_DECIMAL, \"\", \"%08.5f\"\n"
"IFIELD LON_DECIMAL, \"\", \"%08.5f\"\n"
-"IFIELD DESCRIPTION, \"\", \"%s\"\n"
-"IFIELD SHORTNAME, \"\", \"%s\"\n"
+"IFIELD DESCRIPTION, \"\", \"\"%s\"\"\n"
+"IFIELD SHORTNAME, \"\", \"\"%s\"\"\n"
"IFIELD IGNORE, \"\", \"%s\"\n"
"IFIELD CONSTANT, \"ff0000\", \"%s\" # COLOR\n"
"IFIELD CONSTANT, \"47\", \"%s\" # ICON\n"
#
IFIELD LAT_DECIMAL, "", "%08.5f"
IFIELD LON_DECIMAL, "", "%08.5f"
-IFIELD DESCRIPTION, "", "%s"
-IFIELD SHORTNAME, "", "%s"
+IFIELD DESCRIPTION, "", ""%s""
+IFIELD SHORTNAME, "", ""%s""
IFIELD IGNORE, "", "%s"
IFIELD CONSTANT, "ff0000", "%s" # COLOR
IFIELD CONSTANT, "47", "%s" # ICON